using System;
using System.Collections.Generic;
using System.Text;
using Xyne.Network;
using Microsoft.Xna.Framework.Net;

namespace Xyne.Events
{
    /// <summary>
    /// A pattern was selected.
    /// </summary>
    public class PatternSelectedEvent : Event
    {
        private int numSelected;

        public int NumSelected
        {
            get { return numSelected; }
            set { numSelected = value; }
        }

        public PatternSelectedEvent(Object source)
            : base(source)
        {
            DataType = NetworkDataType.PatternSelected;
        }

        public override void Serialize(PacketWriter writer)
        {
            writer.Write(numSelected);
        }

        public static PatternSelectedEvent Deserialize(PacketReader reader)
        {
            PatternSelectedEvent e = new PatternSelectedEvent(null);
            e.NumSelected = reader.ReadInt32();

            return e;
        }
    }
}
